/*
 * author      : 吴中勤 
 * date        : 2019/3/29
 * description : TODO
 */

package org.wzq.learn.domain.member;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.wzq.learn.infrastructure.member.MemberMapper;


@Repository
public class MemberRepository {

    @Autowired
    private MemberMapper memberMapper;

    public MemberEO addMember(MemberEO memberEO) {
        memberMapper.insert(memberEO);
        // 返回值是影响的行数 member的id已经通过 xml的insert 进行了赋值
        // memberEO.setId(id);
        return memberEO;
    }

    public MemberEO findById(Integer id) {
        if (id == null) return null;
        return memberMapper.findById(id);
    }
}
